<script>
function tocallback(){
	if(callbackCardCreated){
		callbackCardCreated();
	}
}
$(function(){
		$("#theform").ajaxForm(function(){
			tocallback();
		});
});
</script>

<div class="card">
	<g:formRemote id="theform" name="form" url="[controller:'card',action:'save']">	
	<div class="cardSprint">
		Story: <g:select name="story.id" from="${stories}" optionKey="id" optionValue="name" value="${card?.story?.id}"/>
	</div>
	<div class="cardTitle">
		Tittle: <g:textField name="title" value="${card?.title}"/>
	</div>
	<div class="cardDescription">
		Description: <g:textArea name="description" value="${card?.description}"/>
	</div>
	<div>
		State: <g:select name="column.id" from="${columns}" optionKey="id" optionValue="name" value="${card?.column?.id}"/>
	</div>
	<div>
		Person: <g:select name="user.id" from="${users}" optionKey="id" optionValue="username" value="${card?.user?.id}"/>
	</div>
	<div>
		Estimated Time: <g:textField name="estimatedTime" value="${card?.estimatedTime}"/>
	</div>
	<div>
		Ramaining Time: <g:textField name="remainingTime" value="${card?.remainingTime}"/>
	</div>
	<div id="submitForm" class="submitForm" style="float: right;cursor: pointer;">
		<input type="submit" value="Save"/>
	</div>
	<g:hiddenField name="id" value="${card?.id}"/>
	<g:hiddenField name="sprint.id" value="${sprint.id}"/>
	</g:formRemote>
</div>